package com.ruoyi.xiaoshou.service.impl;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.xiaoshou.domain.StockOut;
import com.ruoyi.xiaoshou.mapper.StockOutMapper;
import com.ruoyi.xiaoshou.service.IStockOutService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 罗梦杰
 * date 2024/10/25 16:14
 * @version 1.0
 */
@Service
@Slf4j
@Transactional
public class StockOutServiceImpl implements IStockOutService {
    @Autowired
    private StockOutMapper stockOutMapper;
    @Override
    public List<StockOut> getStockOutList(StockOut stockOut) {
        log.info("StockOutServiceImpl getStockOutList params:{}",stockOut);
        List<StockOut> stockOuts =  stockOutMapper.getStockOutList(stockOut);
        return stockOuts;
    }

    @Override
    public AjaxResult getStockOutByCode(StockOut stockOut) {
        log.info("StockOutServiceImpl getStockOutByCode params:{}",stockOut);
        StockOut stockOut1 = stockOutMapper.getStockOutByCode(stockOut);
        return AjaxResult.success(stockOut1);
    }
}
